<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>比赛列表</a></li>
        <li><a href="{:url('Match/add')}">添加比赛</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('Match/index')}">
        参赛战队:
        <input type="text" class="form-control" name="name" style="width: 120px;" value="{:input('request.name')}" placeholder="请输入战队名称">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Match/index')}">清空</a>
    </form>
    <form action="" method="post" class="margin-top-20">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="15%">编号</th>
                <th width="15%">赛事类型</th>
                <th width="15%">甲方</th>
                <th width="5%">盘类型</th>
                <th width="15%">乙方</th>
                <th width="10%">开赛时间</th>
                <th width="5%">是否开赛</th>
                <th width="5%">是否直播</th>
                <th width="5%">是否开放</th>
                <th width="5%">状态</th>
                <th width="15%">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
                <notempty name="data">
                    <volist name="data" id="vo">
                        <tr>
                            <td>{:$vo.match_code}</td>
                            <td>{:$vo.classify}</td>
                            <td><img src="{:$vo.Aicon}" alt="" width="50">{:$vo.Aname}</td>
                            <td>{:$vo.disc}</td>
                            <td><img src="{:$vo.Bicon}" alt="" width="50">{:$vo.Bname}</td>
                            <td>{:date('Y-m-d H:i:s',$vo['startTime'])}</td>
                            <td>
                                <switch name="vo.is_live">
                                    <case value="1">
                                        <a class="btn btn-danger js-ajax-dialog-btn"
                                           data-msg="你确定要{:lang('ENABLED')}"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'is_live'=>2))}">关闭</a>
                                    </case>
                                    <case value="2">
                                        <a class="btn btn-success js-ajax-dialog-btn"
                                           data-msg="你确定要关闭"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'is_live'=>1))}">{:lang('ENABLED')}</a>
                                    </case>
                                    <default/>
                                    未知状态
                                </switch>
                            </td>
                            <td>
                                <switch name="vo.is_live">
                                    <case value="1">
                                        <a class="btn btn-danger js-ajax-dialog-btn"
                                           data-msg="你确定要{:lang('ENABLED')}"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'is_live'=>2))}">关闭</a>
                                    </case>
                                    <case value="2">
                                        <a class="btn btn-success js-ajax-dialog-btn"
                                           data-msg="你确定要关闭"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'is_live'=>1))}">{:lang('ENABLED')}</a>
                                    </case>
                                    <default/>
                                    未知状态
                                </switch>
                            </td>
                            <td>
                                <switch name="vo.bet_num">
                                    <case value="1">
                                        <a class="btn btn-danger js-ajax-dialog-btn"
                                           data-msg="你确定要{:lang('ENABLED')}"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'bet_num'=>2))}">{:lang('DISABLED')}</a>
                                    </case>
                                    <case value="2">
                                        <a class="btn btn-success js-ajax-dialog-btn"
                                           data-msg="你确定要{:lang('DISABLED')}"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'bet_num'=>1))}">{:lang('ENABLED')}</a>
                                    </case>
                                    <default/>
                                    未知状态
                                </switch>
                            </td>
                            <td>
                                <switch name="vo.status">
                                    <case value="0">
                                        <a class="btn btn-success js-ajax-dialog-btn"
                                           data-msg="你确定要进入下一阶段"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'status'=>1))}">不可竞猜</a>
                                    </case>
                                    <case value="1">
                                        <a class="btn btn-success js-ajax-dialog-btn"
                                           data-msg="你确定要进入下一阶段"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'status'=>2))}">可竞猜</a>
                                    </case>
                                    <case value="2">
                                        <a class="btn btn-success js-ajax-dialog-btn"
                                           data-msg="你确定要进入下一阶段"
                                           href="{:url('Match/update',array('id'=>$vo['id'],'status'=>3))}">停止竞猜</a>
                                    </case>
                                    <case value="3">
                                        已经结束
                                    </case>
                                    <default/>
                                    未知状态
                                </switch>
                            </td>

                            <td>
                                <a href="{:url('Match/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                                <a href="{:url('Match/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">
                                    {:lang('DELETE')}
                                </a>
                            </td>
                        </tr>

                    </volist>
                </notempty>
            </tbody>
        </table>
    </form>
    <div class="pagination">{$page|default=''}</div>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>